<template>
	<view>
		<!-- 顶部 -->
		<view class="background">
			<view class="icon" @click="index()">
				<van-icon name="arrow-left" size="22px" />
			</view>
			<view class="food">超市便利</view>
			<view class="search">
				<van-search :value=" value " shape="round" background="#ffffff" placeholder="请输入商家或商品名称" />
			</view>
		</view>
		<!-- 菜单 -->
		<view class="menu_list">
			<view class="menu" v-for="(item,index) in menu">
				<image :src="item.img" mode=""></image>
				<view class="">{{item.name}}</view>
			</view>
		</view>
		<view class="menu_list">
			<view class="menu" v-for="(item,index) in menu_two">
				<image :src="item.img" mode=""></image>
				<view class="">{{item.name}}</view>
			</view>
		</view>
		<view class="nearby">附近商家</view>
		<view class="table">
			<view class="">综合排序</view>
			<view class="">销量最高</view>
			<view class="">速度最快</view>
		</view>
		<!-- 店铺 -->
		<view class="store" v-for="(item,index) in store">
			<image :src="item.img" mode=""></image>
			<view class="store_div">
				<view class="store_name">{{item.name}}</view>
				<view class="store_view">
					<view class="store_score">评分{{item.score}}</view>
					<view class="store_score">月售{{item.value}}</view>
					<view class="store_score">{{item.time}}分钟</view>
					<view class="store_score">{{item.distance}}km</view>
				</view>
				<view class="store_view">
					<view class="store_score">起送￥{{item.send}}</view>
					<view class="store_score">配送￥{{item.del}}</view>
					<view class="meituan">美团专送</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import json from '../../json.js';
	export default {
		data() {
			return {
				menu: null,
				menu_two: null,
				store:null
			}
		},
		methods: {
			index() {
				uni.navigateBack({

				});
			}
		},
		onLoad() {
			this.menu = json.menu;
			this.menu_two = json.menu_two;
			this.store = json.store;
			console.log(this.menu)
			console.log(this.menu_two)
			console.log(this.store)
		}
	}
</script>

<style scoped>
	.meituan{
		text-align: center;
		color: #000000;
		background-color: #ffd161;
		font-size: 12px;
		font-weight: 900;
		padding: 1px;
		border-radius: 5px;
	}
	.store_score{
		font-size: 13px;
		color: #707070;
	}
	.store_div{
		width: 70%;
	}
	.store_view{
		display: flex;
		justify-content: space-around;
	}
	.store_name{
		font-size: 20px;
		padding-left: 9px;
		padding-top: 10px;
	}
	.store{
		display: flex;
		justify-content: start;
		margin-top: 25px;
	}
	.store image{
		width: 105px;
		height: 80px;
	}
	.food {
		font-size: 18px;
		font-weight: 900;
		text-align: center;
		margin-top: -28px;
	}

	.icon {
		padding-top: 30px;
		padding-left: 15px;
	}

	.background {
		background-color: #FFFFFF;
		width: 100%;
		height: 110px;
	}

	.search {
		width: 95%;
		margin-left: 2.5%;
		margin-top: 6px;
		position: absolute;
	}

	.menu image {
		width: 55px;
		height: 55px;
	}

	.menu_list {
		display: flex;
		justify-content: space-around;
		color: #707070;
		font-size: 13px;
		text-align: center;
		margin-top: 8px;
	}

	.nearby {
		font-size: 21px;
		padding-left: 15px;
		padding-top: 30px;
	}

	.table {
		display: flex;
		justify-content: space-around;
		font-weight: 900;
		margin-top: 20px;
	}
</style>
